﻿<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="PageMethodtesting.aspx.cs" Inherits="PageMethodtesting" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script language="javascript" type="text/javascript">
        function CheckForVersion(h) {
            var h = document.getElementById("txtAbc").value;            
            PageMethods.chek(h, OnSucceeded, OnFailed);
            //        PageMethods.CheckForVersion(aspnetForm.ctl00$ContentPlaceHolder1$ddlPageName2.value, aspnetForm.ctl00$ContentPlaceHolder1$txtContentName2.value, OnSucceeded, OnFailed);
           
        }

    function OnSucceeded(results,userContext, methodName){       
        alert(results);
    }

    function OnFailed(error,userContext, methodName) {
        // handle pagemethod error
        alert(error.get_message());
    }

</script>

</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" EnablePageMethods="true" runat="server">
    </asp:ScriptManager>
    <div>
        <asp:TextBox ID="txtAbc" runat="server"></asp:TextBox>
        <asp:Button ID="btn" runat="server" Text="Test" OnClientClick="return CheckForVersion();" />
    </div>
    </form>
</body>
</html>
